﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:UIElements="clr-namespace:TfsWorkbench.UIElements.DragHelpers;assembly=TfsWorkbench.UIElements"
	>

	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="CommonElements.xaml"/>
        <ResourceDictionary Source="/TfsWorkbench.UIElements;Component/Resources/CommandButtonStyles.xaml"/>
    </ResourceDictionary.MergedDictionaries>
	
	<Style x:Key="DragListViewStyle" TargetType="{x:Type UIElements:DragListView}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="AllowDrop" Value="True" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type UIElements:DragListView}">
					<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
						<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</ScrollViewer>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ItemsPanel">
			<Setter.Value>
                <ItemsPanelTemplate>
                    <WrapPanel IsItemsHost="True"  />
                </ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsDragOver" Value="True" />
					<Condition Property="IsDropValid" Value="True" />
				</MultiTrigger.Conditions>
				<MultiTrigger.Setters>
					<Setter Property="BorderBrush" Value="{StaticResource ValidDropLocationBorderBrush}" />
				</MultiTrigger.Setters>
			</MultiTrigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsDragOver" Value="True" />
					<Condition Property="IsDropValid" Value="False" />
				</MultiTrigger.Conditions>
				<MultiTrigger.Setters>
					<Setter Property="BorderBrush" Value="{StaticResource InvalidDropLocationBorderBrush}" />
				</MultiTrigger.Setters>
			</MultiTrigger>
		</Style.Triggers>
	</Style>
</ResourceDictionary>